<script setup lang="ts">
import {ref} from 'vue'
import {useRouter} from "vue-router";
const tiaozuan=useRouter()
const tohuoqu=()=>{
tiaozuan.push({name:"huoqu"})
}
const totime=()=>{
  tiaozuan.push({
    name:'time'
  })
}
</script>

<template>
<div id="a1">
  <div id="d1">
  <router-link to="/huoqu">实时获取文本信息</router-link>
    <br>
  <router-link to="/time">实时获取当前时间</router-link>
    <br>
  <button @click="tohuoqu">实时获取文本框的值</button>
  <br>
  <button @click="totime">获取当前时间</button>
  </div>
  <div id="d2">
    <RouterView/>

  </div>
   <br>
</div>
</template>
<style scoped>
#a1{
  display: flex;
  height: 100vh;
}
#d1{
  width: 20%;
  height: 100%;
  background-color:darkturquoise;
}
#d2{
  flex: 1;
  background-color: lightskyblue;
}
</style>